import axios from "axios";

//创建axios实例化
const service=axios.create({
    baseURL:'http://localhost:3000',
    baseURL:'',
   timeout:60000,
   headers:{
       "Content-Type":"application/json;charset=UtTF-8"
   }
})

service.interceptors.request.use(
    config=>{
        return config;
    },
    error=>{
        console.log('请求报错',error);
        Promise.reject(error)
    }
)

service.interceptors.response.use(
    response=>{
        return response.data;
    },
    error=>{
         console.log('请求报错',error);
        Promise.reject(error)
    }
)
// 暴露
export default service